home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / asm / demos / howtoskinacat / fractalcube / picpreprocess.s < prev    next >
Text File  |  1980-01-03  |  2KB  |  121 lines

  1. ùúùúÿ짇ÿ짇ÿ짇ÿ짇ÿ짇ÿ짇ÿ짇ÿ짇ÿ짇;------------------T--------T
  2. *******************************************************************************
  3. **
  4. **  Picture-preprocessor
  5. **
  6. **  output:
  7. **  a0=save start
  8. **  a1=save end
  9. **
  10. *******************************************************************************
  11.  
  12. Begin:    lea    RawPicture(pc),a0
  13.     lea    DotPicture(pc),a1
  14.     bsr    PicPreprocess
  15.     lea    DotPicture(pc),a0
  16.     lea    CodePicture,a1
  17.     lea    CodePointers,a2
  18.     bsr    GenerateCode
  19.     lea    CodePointers,a0
  20.     rts
  21.  
  22. GenerateCode:    moveq    #128-1,d3
  23.     move.l    a1,a4
  24. .nextsojle    move.l    a1,a3
  25.     sub.l    a4,a3
  26.     move.l    a3,(a2)+
  27.     moveq    #0,d2    ;gammel farve
  28. .sojleloop    moveq    #0,d0
  29.     move.b    (a0)+,d0    ;pos
  30.     cmp.b    #$ff,d0
  31.     bne.b    .ok
  32.     move.w    #$4E75,(a1)+
  33.     dbra    d3,.nextsojle
  34.     rts
  35. .ok    move.w    Instr1(pc),(a1)+
  36.     add.w    d0,d0
  37.     move.w    d0,(a1)+
  38.     move.b    (a0)+,d1    ;farve
  39.  
  40.     eor.b    d1,d2
  41.     btst    #0,d2
  42.     beq.b    .plan0ok
  43.     move.w    Instr2(pc),(a1)+
  44.     clr.w    (a1)+
  45. .plan0ok    btst    #1,d2
  46.     beq.b    .plan1ok
  47.     move.w    Instr2(pc),(a1)+
  48.     move.w    #32,(a1)+
  49. .plan1ok    btst    #2,d2
  50.     beq.b    .plan2ok
  51.     move.w    Instr2(pc),(a1)+
  52.     move.w    #32*2,(a1)+
  53. .plan2ok    btst    #3,d2
  54.     beq.b    .plan3ok
  55.     move.w    Instr2(pc),(a1)+
  56.     move.w    #32*3,(a1)+
  57. .plan3ok
  58.     move.b    d1,d2
  59.     bra.b    .sojleloop
  60.  
  61. Instr1:    move.w    0(a0),d0        ;0=ypos
  62. Instr2:    bchg    d1,(a1,d0.w)
  63.  
  64.  
  65.  
  66. PicWidth:    EQU    16
  67.  
  68. PicPreprocess:    moveq    #16-1,d3    ;bytesøjler
  69. .byteloop    moveq    #7,d2    ;bitnummer
  70. .bitloop    moveq    #128-1,d6
  71.     moveq    #0,d5    ;gammel farve
  72.     moveq    #0,d0
  73.  
  74. .sojleloop    moveq    #0,d4    ;farve
  75.     btst    d2,(a0)
  76.     beq.b    .plan1ok
  77.     bset    #0,d4
  78. .plan1ok    btst    d2,PicWidth(a0)
  79.     beq.b    .plan2ok
  80.     bset    #1,d4
  81. .plan2ok    btst    d2,PicWidth*2(a0)
  82.     beq.b    .plan3ok
  83.     bset    #2,d4
  84. .plan3ok    btst    d2,Picwidth*3(a0)
  85.     beq.b    .plan4ok
  86.     bset    #3,d4
  87. .plan4ok
  88.     cmp.b    d4,d5
  89.     beq.b    .nextline
  90.  
  91.     move.b    d4,d5
  92.     move.b    d0,(a1)+
  93.     move.b    d5,(a1)+
  94. .nextline    lea    PicWidth*4(a0),a0
  95.     addq.w    #1,d0
  96.     dbra    d6,.sojleloop
  97.     tst.b    d5
  98.     beq.b    .zero
  99.     move.b    d0,(a1)+
  100.     clr.b    (a1)+
  101. .zero    st    (a1)+
  102.     lea    -128*PicWidth*4(a0),a0
  103.     dbra    d2,.bitloop
  104.     addq.w    #1,a0
  105.     dbra    d3,.byteloop
  106.     rts
  107.  
  108.  
  109.  
  110.  
  111.  
  112.     INCDIR    "Work:Code/Sources/HTSAC/FractalCube/"
  113. RawPicture:    INCIFF    "Ant.iff"
  114.  
  115. DotPicture:    blk.b    100000,0
  116.  
  117. CodePointers:    blk.l    128,0
  118. CodePicture:    blk.b    100000,0
  119.  
  120.  
  121.